package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.wemedia.service.ChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @projectName: heima-leadnews
 * @package: com.heima.wemedia.controller.v1
 * @className: Channel
 * @author: 躺着认真玩
 * @description: 文章内容频道列表
 * @date: 2025/5/19 7:18
 * @version: 1.0
 */
@RestController
@RequestMapping("/api/v1/channel")
public class ChannelController {
    @Autowired
    private ChannelService channelService;

    @GetMapping("/channels")
    public ResponseResult channeList(){
        return ResponseResult.okResult(channelService.lambdaQuery().eq(WmChannel::getStatus,1).list());
    }
}
